package com.atguigu.gulimall.order.vo;

import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;


public class OrderConfirmVo {
    @Getter @Setter
    List<MemberAddressVo> address;
    @Getter @Setter
    List<OrderItemVo> orderItemVos;
    @Getter @Setter
    private Integer integration;
    @Getter @Setter
    Integer count;

    BigDecimal total;
    @Getter @Setter
    Map<Long,Boolean> hasStoke;


    public BigDecimal getTotal() {
        BigDecimal bigDecimal = new BigDecimal("0");
        for (OrderItemVo orderItemVo : this.orderItemVos) {
            bigDecimal=bigDecimal.add(orderItemVo.getTotalPrice());
        }
        return bigDecimal;
    }

    BigDecimal payTotal;

    public BigDecimal getPayTotal() {
        return getTotal();
    }
    @Getter @Setter
    String orderToken;

    @Override
    public String toString() {
        return "OrderConfirmVo{" +
                "address=" + address +
                ", orderItemVos=" + orderItemVos +
                ", integration=" + integration +
                ", count=" + count +
                ", total=" + total +
                ", payTotal=" + payTotal +
                ", orderToken='" + orderToken + '\'' +
                '}';
    }
}
